#ifndef _ADC_
#define _ADC_
              
#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>
#include "cw32f003_adc.h"

#define ADC_GPIO_PORT    CW_GPIOB
#define ADC_GPIO_PINS    GPIO_PIN_5 | GPIO_PIN_6


extern uint16_t valueAdc;
extern volatile uint8_t gFlagIrq;
extern uint8_t currentChannel;


void ADC_Initialize(void);

void ADC_IRQHandlerCallback(void);

float Get_Voltage(uint16_t adc);

float Get_Current(uint16_t adc);

void ADC_SelectChannel(uint32_t channel);

void Collection_Voltage_Current(void);

#ifdef __cplusplus
}
#endif

#endif

